home *** CD-ROM | disk | FTP | other *** search
- #ifndef __SAMPDRVR__
- #define __SAMPDRVR__
- #include <Types.h>
- #include <Quickdraw.h>
- #include <Files.h>
- #include <Devices.h>
- #include "tracksinfo.h"
-
-
- #define theKeyMap ((short *)(0x0174)) // These routines stolen from the JMP libraries
- #define TEST_FLAG(f,m) (((f) & (m)) == (m)) /* f = flag, m = mask; mask should not be zero! */
- #define MAKE_EVEN(n) (((n) + 1) & ~1)
-
- #define CAPS_LOCK_DOWN() (TEST_FLAG(theKeyMap[3],0x0002))
- #define OPTION_KEY_DOWN() (TEST_FLAG(theKeyMap[3],0x0004))
- #define CMD_KEY_DOWN() (TEST_FLAG(theKeyMap[3],0x8000))
-
- /* Debugging aids… (if capsLock key is down)
- */
- #define DEBUG(s) if (CAPS_LOCK_DOWN()) DebugStr(s)
- #define FREEZE() while (CAPS_LOCK_DOWN())
-
-
-
- typedef struct
- {
-
- /* TestDrvr globals */
- long EventCount; // keeps track of how many times the driver has received a accRun csCode.
-
- /* Mandatory Tracks Globals */
-
- ProcPtr fTraceProcPtr; /* Points to trace driver's TraceProc routine (or nil) */
- Ptr fTraceArg; /* Contains the trace driver's refCon value (points to its globals) */
-
- } Globals;
-
- OSErr TControl(CntrlParam *ctlPB, DCtlPtr dCtl);
- OSErr TOpen(CntrlParam *ctlPB, DCtlPtr dCtl);
- OSErr TPrime(CntrlParam *ctlPB, DCtlPtr dCtl);
- OSErr TStatus(CntrlParam *ctlPB, DCtlPtr dCtl);
-
- pascal short DrvrEntry(Globals *globals, short csCode, Ptr paramPtr, DCtlPtr dCtl);
- void HandleOptKeyDown(Globals *globals);
- void HandleCmdKeyDown(Globals *globals, DCtlPtr dCtl);
-
- enum {kStackPeekEx, kCmdKeyDown, kOptKeyDown, kUnexpectedErr}; /* For DiagID's 0-31 */
- // If we wanted to implement Trace Levels 2, 3, and/or 4, we'd define them here...
-
- #endif
-